/**
 * Created by zhu on 2016/2/2.
 */
$(function () {
    var myhregf = window.location.href;
    var count = myhregf.split('/').length;
    var id = myhregf.split('/')[count - 1];
    $('#weixing').on('click', function () {
        $.get(contextPath + "/order/payment/" + 1 + "/" + id, function (data) {
            judge(data)
        })
    });

    $('#zhifubao').on('click', function () {
        $.get(contextPath + "/order/payment/" + 2 + "/" + id, function (data) {
            judge(data)
        })
    });

    $('#yinghang').on('click', function () {
        $.get(contextPath + "/order/payment/" + 3 + "/" + id, function (data) {
            judge(data)

        })
    })

});

function judge(data) {
    data = $.parseJSON(data);
    if (data.status == 0) {
        window.location.href = contextPath + "/my/personalCenter";
    } else {
        alert("上传失败")
    }
}
